Refactored IEventListener and IEventSink to handle garbage data according to configur...
[lwes-dotnet/github-mirror.git] / Org.Lwes / Sample Configuration.config
blob842a0611a8d9d166fa859f99e9f421b27421eaf4
1 <?xml version="1.0" encoding="utf-8" ?>\r
2 <configuration>\r
3         <configSections>\r
4                 <section name="lwes"\r
5                                                  type="Org.Lwes.Config.LwesConfigurationSection, Org.Lwes"/>\r
6         </configSections>\r
7         <!-- \r
8         LWES configuration section\r
9         \r
10         Attributes:\r
11         \r
12         "maximumBufferMemory" - Represents the maximum amount of memory used for\r
13         buffering events. This maximum is enforced by the BufferManager and will\r
14         limit the throughput of both emitters and listeners if the setting is not\r
15         large enough for the speed at which events are submitted to LWES. Note \r
16         that the maximum must be large enough for at least 3 simultaneous buffers\r
17         of size "bufferAllocationLength" in order for the ParallelEmitter and \r
18         ParallelListener to function properly. Default value is 0x20000000, or .5GB\r
19         \r
20         "bufferAllocationLength" - Represents the default buffer allocation length.\r
21         Listeners acquire buffers of this length from the BufferManager when waiting\r
22         for incoming events. This setting should be large enough to hold a single\r
23         serialized LWES event, but as LWES uses the UDP protocol it isn't useful to\r
24         make the buffer larger than the default value of 65535.\r
25         \r
26         Nodes:\r
27         \r
28         "emitters" - A collection of named emitter configurations.\r
29         \r
30         "listeners" - A collection of named listener configurations.\r
31         \r
32         "templateDBs" - A collection of named template DBs.      \r
33         -->\r
34         <lwes maximumBufferMemory="0x20000000" bufferAllocationLength="65535">\r
35                 <emitters>\r
36                         <!-- \r
37                         Adds a named event emitter.\r
38                         \r
39                         LWES will sets up a default emitter automatically. The default emitter is\r
40                         equivelent to the following node:\r
41                         \r
42                         &lt;add name="deafult" \r
43                                 multicast="true" \r
44                                 parallel="true"\r
45                                 encoding="Default"\r
46                                 address="224.0.0.69"\r
47                                 port="9191"\r
48                                 multicastTimeToLive="31"&gt;\r
49                                 \r
50                         You may override the default emitter by adding your own emitter named "default".\r
51                         \r
52                         Attributes:\r
53                         \r
54                         "name" = { case-sensitive-string } - the name of the emitter. \r
55                         This attribute is required.\r
56                                                 \r
57                         "parallel" = { true | false } - indicates whether the emitter will use the \r
58                         parallel emitting       strategy. The default value is "true"; if set to "false" \r
59                         then the emitter will use the direct strategy. The parallel strategy will \r
60                         utilize between 0 and 3 threadpool threads to emit events to LWES. The parallel \r
61                         strategy non-blocking   and thread-safe. The direct strategy serializes and sends \r
62                         the event to LWES utilizing the calling thread and may block during the IO \r
63                         operation.\r
64                         \r
65                         "multicast" = { true | false } - indicates whether the emitter will multicast\r
66                         the event to LWES       or unicast. The default value is "true"; if set to "false" \r
67                         the emitter will use unicast.\r
68                         \r
69                         "encoding" = { UTF_8 | ISO_8859_1 | Default } - indicates the encoding used \r
70                         for events created by the emitter. The default value is "UTF_8".\r
71                         \r
72                         "address" = { ip-address-string } - indicates the IP address for emitting LWES\r
73                         events. The default value is "224.0.0.69".\r
74                         \r
75                         "port" = { integer-string } - indicates the port for emitting LWES\r
76                         events. The default value is "9191".\r
77                         \r
78                         "multicastTimeToLive" = { true | false } - indicates the multicast time-to-live\r
79                         utilized if the emitter is using multicast; otherwise it is ignored.\r
80                         -->\r
81                         <add name="secondary"\r
82                                          multicast="true"\r
83                                          parallel="false"\r
84                                          address="127.0.0.1"\r
85                                          port="1313"\r
86                                          multicastTimeToLive="2"/>\r
87                 </emitters>\r
88                 <listeners>\r
89                         <!-- \r
90                         Adds a named event listener.\r
91                         \r
92                         LWES will sets up a default listener automatically. The default listener is\r
93                         equivelent to the following node:\r
94                         \r
95                         &lt;add name="deafult" \r
96                                 multicast="true" \r
97                                 parallel="true"\r
98                                 address="224.0.0.69"\r
99                                 port="9191"\r
100                                 garbageHandling="FailSilently"/>\r
101                                 \r
102                         You may override the default listener by adding your own listener named "default".\r
103                         \r
104                         Attributes:\r
105                         \r
106                         "name" = { case-sensitive-string } - the name of the listener. \r
107                         This attribute is required.\r
108                                                 \r
109                         "parallel" = { true | false } - indicates whether the listener will use the \r
110                         parallel listening      strategy. The default value is "true"; if set to "false" \r
111                         then the listener will use the multithreaded strategy. The parallel strategy will \r
112                         utilize between 1 and 3 threadpool threads to receive events from LWES and\r
113                         issue the corresponding dotNET events. The parallel strategy non-blocking       and \r
114                         thread-safe. The multithreaded strategy uses 2 dedicated background threads; one\r
115                         for listening to the socket and another for deserializing and dispatching the\r
116                         corresponding dotNET events.\r
117                         \r
118                         "multicast" = { true | false } - indicates whether the listener will join a \r
119                         multicast group when listening for LWES events. The default value is "true"; \r
120                         if set to "false" the emitter will use unicast.\r
121                         \r
122                         "address" = { ip-address-string } - indicates the IP address for listener for\r
123                         LWES events. The default value is "224.0.0.69".\r
124                         \r
125                         "port" = { integer-string } - indicates the port for listening for LWES\r
126                         events. The default value is "9191".                    \r
127                         \r
128                         "garbageHandling" = { Default | FailSilently | IgnoreEndpointsThatSendGarbage\r
129                         | AskEventSinksToVoteOnStrategy | 0 | 1 | 2 } - indicates the garbage handling \r
130                         strategy used by the listener. Possible values follow...\r
131                         \r
132                                 Default | FailSilenty | 0 - Indicates that the listener should silently handle\r
133                                         garbage data by discarding it and continue processing all incomming data.\r
134                                         \r
135                                 IgnoreEndpointsThatSendGarbage | 1 - indicates that the listener should track\r
136                                         endpoints that send garbage data and stop processing data from endpoints if\r
137                                         garbage data is received from an endpoint.\r
138                                         \r
139                                 AskEventSinksToVoteOnStrategy | 2 - indicates that the event sinks should be \r
140                                         asked to vote on the strategy to use on a per-endpoint basis. Each active \r
141                                         event sink's HandleGarbageData method will be invoked and the most\r
142                                         restrictive vote will dictate how future traffic from the endpoint is \r
143                                         handled. Possiblities are { None | TreatTrafficFromEndpointAsGarbage\r
144                                         | IgnoreAllTrafficFromEndpoint }. See the documentation for the IEventSink\r
145                                         interface for more info.\r
146                         -->\r
147                         <add name="secondary"\r
148                                          multicast="true"\r
149                                          parallel="false"\r
150                                          address="127.0.0.1"\r
151                                          port="1313"/>\r
152                 </listeners>\r
153                 <templateDBs>\r
154                         <add name="default"\r
155                                          path="$(AppPath)\event_templates"/>\r
156                 </templateDBs>\r
157         </lwes>\r
158         <system.diagnostics>\r
159                 <sources>\r
160                         <source name="lwes-switch" switchName="DebugSwitch" switchType="System.Diagnostics.SourceSwitch" >\r
161                                 <listeners>\r
162                                         <add name="lwes" />\r
163                                 </listeners>\r
164                         </source>\r
165                 </sources>\r
166                 <switches>\r
167                         <add name="DebugSwitch" value="Verbose" />\r
168                 </switches>\r
169                 <sharedListeners>\r
170                         <!-- \r
171                         Adds an LwesTraceListener as a shared listener.\r
172                                                                         \r
173                         Attributes:\r
174                         \r
175                         "name" = { case-sensitive-string } - the name of the listener. \r
176                         This attribute is required. NOTE: This names the LwesTraceListener among\r
177                         the dotNET framework's TraceListeners and is unrelated to the names found\r
178                         in under the "lwes" configuration section.\r
179                         \r
180                         "type" = { type-reference }\r
181                         \r
182                         "BindEmitterByName" = { lwes-emitter-name } - causes the trace listener to\r
183                         use an emitter configured under the "lwes" configuration section.\r
184                                                 \r
185                         "Parallel" = { true | false } - indicates whether the listener will use the \r
186                         parallel listening      strategy. The default value is "true"; if set to "false" \r
187                         then the listener will use the multithreaded strategy. The parallel strategy will \r
188                         utilize between 1 and 3 threadpool threads to receive events from LWES and\r
189                         issue the corresponding dotNET events. The parallel strategy non-blocking       and \r
190                         thread-safe. The multithreaded strategy uses 2 dedicated background threads; one\r
191                         for listening to the socket and another for deserializing and dispatching the\r
192                         corresponding dotNET events.\r
193                         \r
194                         "Multicast" = { true | false } - indicates whether the listener will join a \r
195                         multicast group when listening for LWES events. The default value is "true"; \r
196                         if set to "false" the emitter will use unicast.\r
197                         \r
198                         "Address" = { ip-address-string } - indicates the IP address for listener for\r
199                         LWES events. The default value is "224.0.0.69".\r
200                         \r
201                         "Port" = { integer-string } - indicates the port for listening for LWES\r
202                         events. The default value is "9191".\r
203                         -->\r
204                         <add name="lwes" type="Org.Lwes.LwesTraceListener, Org.Lwes"\r
205                                          initializeData="TestListener"\r
206                                          Multicast="true"\r
207                                          Address = "224.0.0.69"\r
208                                          Port = "9191"\r
209                                          MutlicastTimeToLive = "31"\r
210                                 />\r
211                 </sharedListeners>\r
212                 <trace autoflush="true" indentsize="2" />\r
213         </system.diagnostics>\r
214 </configuration>